package com.zhsj.OkeHomeConsumption.ui.fragment.integral.adapter;

import android.support.annotation.NonNull;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.zhsj.OkeHomeConsumption.R;
import com.zhsj.OkeHomeConsumption.empty.IntegralBean;
import com.zhsj.OkeHomeConsumption.view.CircleImageView;

public class IntegralAdapter extends BaseQuickAdapter<IntegralBean, BaseViewHolder> {
    public IntegralAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, IntegralBean item) {
        helper.setText(R.id.data_text, item.getCreateDate());
        CircleImageView circleImageView = helper.getView(R.id.integral_image);
        Glide.with(mContext).load(item.getIntegralHeadImg()).into(circleImageView);
        if (item.getIntegralText2().equals("推广奖励")){
            helper.setImageResource(R.id.type_image, R.mipmap.icon_tuiguang);
        }else if (item.getIntegralText2().equals("推荐奖")){
            helper.setImageResource(R.id.type_image, R.mipmap.icon_tuijian);
        } else if (item.getIntegralText2().equals("导师奖")){
            helper.setImageResource(R.id.type_image, R.mipmap.icon_daoshi);
        } else if (item.getIntegralText2().equals("带队奖")){
            helper.setImageResource(R.id.type_image, R.mipmap.icon_daidui);
        }

        helper.setText(R.id.integral_text, item.getIntegral() + " 积分");

    }
}
